#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
using namespace std;
int main(){
	map<char,int> maps;
	string input;
	cin >> input;
	for(int i = 0;i < input.length();i++){
		maps[input[i]]++;
	}
	while(maps['S'] || maps['t'] || maps['r'] || maps['i'] || maps['n'] || maps['g']){
		if(maps['S']){cout << 'S';maps['S']--;}
		if(maps['t']){cout << 't';maps['t']--;}
		if(maps['r']){cout << 'r';maps['r']--;}
		if(maps['i']){cout << 'i';maps['i']--;}
		if(maps['n']){cout << 'n';maps['n']--;}
		if(maps['g']){cout << 'g';maps['g']--;}
	}
	
	return 0;
}
